﻿using System;
using System.Collections.Generic;
using System.Linq;
using Gumini.JulaDB.DataTypes;

namespace Gumini.JulaDB.Expressions.Operators
{
    internal abstract class Operator
    {
        private readonly string[] _names;

        protected Operator(int numberOfArguments, params string[] names)
        {
            if (!names.Any())
                throw new ArgumentException(String.Format("{0}: Operator must have at least one name.", this.GetType()));
            this.NumberOfArguments = numberOfArguments;
            _names = names;
        }

        public IEnumerable<string> Names
        {
            get { return _names; }
        }

        public int NumberOfArguments { get; private set; }

        public abstract DataType GetReturnType();
    }
}
